export function formateDate(val:string|null){
    if(!val) return "";
    let date = new Date(val);
    let year = date.getFullYear();
    year < 10 ? "0" + year : year;
    let month = date.getMonth() + 1 ;
    month < 10 ? "0" + month : month;
    let day = date.getDate();
    day < 10 ? "0" + day : day;
    let h = date.getHours();
    h < 10 ? "0" + h : h;
    let m = date.getMinutes();
    m < 10 ? "0" + m : m;
    let s = date.getSeconds();
    s < 10 ? "0" + s : s;
    return year +'-'+ month +'-'+ day + " " + h+':' + m+':' + s;
}